package com.zj.osm.entity.db;

import java.util.List;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.query.Query;
import org.greenrobot.greendao.query.QueryBuilder;

import com.zj.osm.entity.greendao.PointAndLineBean;

import com.zj.osm.entity.greendao.Line;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** 
 * DAO for table "LINE".
*/
public class LineDao extends AbstractDao<Line, Long> {

    public static final String TABLENAME = "LINE";

    /**
     * Properties of entity Line.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
        public final static Property LineId = new Property(1, String.class, "lineId", false, "LINE_ID");
        public final static Property Cid = new Property(2, String.class, "cid", false, "CID");
        public final static Property Start_id = new Property(3, String.class, "start_id", false, "START_ID");
        public final static Property End_id = new Property(4, String.class, "end_id", false, "END_ID");
        public final static Property ProjectId = new Property(5, Long.class, "projectId", false, "PROJECT_ID");
        public final static Property Name = new Property(6, String.class, "name", false, "NAME");
        public final static Property RoadPands = new Property(7, String.class, "roadPands", false, "ROAD_PANDS");
        public final static Property RoadAdress = new Property(8, String.class, "roadAdress", false, "ROAD_ADRESS");
        public final static Property ResType = new Property(9, String.class, "resType", false, "RES_TYPE");
        public final static Property ResSpec = new Property(10, String.class, "resSpec", false, "RES_SPEC");
        public final static Property DlzjSpec = new Property(11, String.class, "dlzjSpec", false, "DLZJ_SPEC");
        public final static Property ArdUseNumer = new Property(12, String.class, "ardUseNumer", false, "ARD_USE_NUMER");
        public final static Property ElectriHoleNumer = new Property(13, String.class, "electriHoleNumer", false, "ELECTRI_HOLE_NUMER");
        public final static Property RemaNumber = new Property(14, String.class, "remaNumber", false, "REMA_NUMBER");
        public final static Property RoadUtili = new Property(15, String.class, "roadUtili", false, "ROAD_UTILI");
        public final static Property ResLength = new Property(16, String.class, "resLength", false, "RES_LENGTH");
        public final static Property Note = new Property(17, String.class, "note", false, "NOTE");
        public final static Property SrcYear = new Property(18, String.class, "srcYear", false, "SRC_YEAR");
        public final static Property Category = new Property(19, String.class, "category", false, "CATEGORY");
        public final static Property Type = new Property(20, String.class, "type", false, "TYPE");
        public final static Property TypeId = new Property(21, String.class, "typeId", false, "TYPE_ID");
        public final static Property Types = new Property(22, String.class, "types", false, "TYPES");
        public final static Property Pipe_laying_state = new Property(23, String.class, "pipe_laying_state", false, "PIPE_LAYING_STATE");
        public final static Property State = new Property(24, String.class, "state", false, "STATE");
        public final static Property BackNum = new Property(25, String.class, "backNum", false, "BACK_NUM");
        public final static Property Num = new Property(26, String.class, "num", false, "NUM");
        public final static Property MethodName = new Property(27, String.class, "methodName", false, "METHOD_NAME");
        public final static Property Length = new Property(28, String.class, "length", false, "LENGTH");
        public final static Property Line_len = new Property(29, String.class, "line_len", false, "LINE_LEN");
        public final static Property Item_id = new Property(30, Long.class, "item_id", false, "ITEM_ID");
        public final static Property LatA = new Property(31, String.class, "latA", false, "LAT_A");
        public final static Property LatB = new Property(32, String.class, "latB", false, "LAT_B");
        public final static Property LonA = new Property(33, String.class, "lonA", false, "LON_A");
        public final static Property LonB = new Property(34, String.class, "lonB", false, "LON_B");
        public final static Property Name_a = new Property(35, int.class, "name_a", false, "NAME_A");
        public final static Property Name_b = new Property(36, int.class, "name_b", false, "NAME_B");
        public final static Property ParallelPole = new Property(37, String.class, "parallelPole", false, "PARALLEL_POLE");
        public final static Property IsT = new Property(38, String.class, "isT", false, "IS_T");
        public final static Property Path = new Property(39, String.class, "path", false, "PATH");
        public final static Property ModuleID = new Property(40, String.class, "moduleID", false, "MODULE_ID");
        public final static Property ModuleTxt = new Property(41, String.class, "moduleTxt", false, "MODULE_TXT");
        public final static Property LegendTypeKey = new Property(42, String.class, "legendTypeKey", false, "LEGEND_TYPE_KEY");
        public final static Property FenZhiLineId = new Property(43, String.class, "fenZhiLineId", false, "FEN_ZHI_LINE_ID");
        public final static Property FenZhiLineChecked = new Property(44, boolean.class, "fenZhiLineChecked", false, "FEN_ZHI_LINE_CHECKED");
    }

    private DaoSession daoSession;

    private Query<Line> point_LineListQuery;
    private Query<Line> project_LineListQuery;

    public LineDao(DaoConfig config) {
        super(config);
    }
    
    public LineDao(DaoConfig config, DaoSession daoSession) {
        super(config, daoSession);
        this.daoSession = daoSession;
    }

    /** Creates the underlying database table. */
    public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"LINE\" (" + //
                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
                "\"LINE_ID\" TEXT," + // 1: lineId
                "\"CID\" TEXT," + // 2: cid
                "\"START_ID\" TEXT," + // 3: start_id
                "\"END_ID\" TEXT," + // 4: end_id
                "\"PROJECT_ID\" INTEGER," + // 5: projectId
                "\"NAME\" TEXT," + // 6: name
                "\"ROAD_PANDS\" TEXT," + // 7: roadPands
                "\"ROAD_ADRESS\" TEXT," + // 8: roadAdress
                "\"RES_TYPE\" TEXT," + // 9: resType
                "\"RES_SPEC\" TEXT," + // 10: resSpec
                "\"DLZJ_SPEC\" TEXT," + // 11: dlzjSpec
                "\"ARD_USE_NUMER\" TEXT," + // 12: ardUseNumer
                "\"ELECTRI_HOLE_NUMER\" TEXT," + // 13: electriHoleNumer
                "\"REMA_NUMBER\" TEXT," + // 14: remaNumber
                "\"ROAD_UTILI\" TEXT," + // 15: roadUtili
                "\"RES_LENGTH\" TEXT," + // 16: resLength
                "\"NOTE\" TEXT," + // 17: note
                "\"SRC_YEAR\" TEXT," + // 18: srcYear
                "\"CATEGORY\" TEXT," + // 19: category
                "\"TYPE\" TEXT," + // 20: type
                "\"TYPE_ID\" TEXT," + // 21: typeId
                "\"TYPES\" TEXT," + // 22: types
                "\"PIPE_LAYING_STATE\" TEXT," + // 23: pipe_laying_state
                "\"STATE\" TEXT," + // 24: state
                "\"BACK_NUM\" TEXT," + // 25: backNum
                "\"NUM\" TEXT," + // 26: num
                "\"METHOD_NAME\" TEXT," + // 27: methodName
                "\"LENGTH\" TEXT," + // 28: length
                "\"LINE_LEN\" TEXT," + // 29: line_len
                "\"ITEM_ID\" INTEGER," + // 30: item_id
                "\"LAT_A\" TEXT," + // 31: latA
                "\"LAT_B\" TEXT," + // 32: latB
                "\"LON_A\" TEXT," + // 33: lonA
                "\"LON_B\" TEXT," + // 34: lonB
                "\"NAME_A\" INTEGER NOT NULL ," + // 35: name_a
                "\"NAME_B\" INTEGER NOT NULL ," + // 36: name_b
                "\"PARALLEL_POLE\" TEXT," + // 37: parallelPole
                "\"IS_T\" TEXT," + // 38: isT
                "\"PATH\" TEXT," + // 39: path
                "\"MODULE_ID\" TEXT," + // 40: moduleID
                "\"MODULE_TXT\" TEXT," + // 41: moduleTxt
                "\"LEGEND_TYPE_KEY\" TEXT," + // 42: legendTypeKey
                "\"FEN_ZHI_LINE_ID\" TEXT," + // 43: fenZhiLineId
                "\"FEN_ZHI_LINE_CHECKED\" INTEGER NOT NULL );"); // 44: fenZhiLineChecked
        // Add Indexes
        db.execSQL("CREATE UNIQUE INDEX " + constraint + "IDX_LINE_LINE_ID ON \"LINE\"" +
                " (\"LINE_ID\" ASC);");
    }

    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LINE\"";
        db.execSQL(sql);
    }

    @Override
    protected final void bindValues(DatabaseStatement stmt, Line entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String lineId = entity.getLineId();
        if (lineId != null) {
            stmt.bindString(2, lineId);
        }
 
        String cid = entity.getCid();
        if (cid != null) {
            stmt.bindString(3, cid);
        }
 
        String start_id = entity.getStart_id();
        if (start_id != null) {
            stmt.bindString(4, start_id);
        }
 
        String end_id = entity.getEnd_id();
        if (end_id != null) {
            stmt.bindString(5, end_id);
        }
 
        Long projectId = entity.getProjectId();
        if (projectId != null) {
            stmt.bindLong(6, projectId);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(7, name);
        }
 
        String roadPands = entity.getRoadPands();
        if (roadPands != null) {
            stmt.bindString(8, roadPands);
        }
 
        String roadAdress = entity.getRoadAdress();
        if (roadAdress != null) {
            stmt.bindString(9, roadAdress);
        }
 
        String resType = entity.getResType();
        if (resType != null) {
            stmt.bindString(10, resType);
        }
 
        String resSpec = entity.getResSpec();
        if (resSpec != null) {
            stmt.bindString(11, resSpec);
        }
 
        String dlzjSpec = entity.getDlzjSpec();
        if (dlzjSpec != null) {
            stmt.bindString(12, dlzjSpec);
        }
 
        String ardUseNumer = entity.getArdUseNumer();
        if (ardUseNumer != null) {
            stmt.bindString(13, ardUseNumer);
        }
 
        String electriHoleNumer = entity.getElectriHoleNumer();
        if (electriHoleNumer != null) {
            stmt.bindString(14, electriHoleNumer);
        }
 
        String remaNumber = entity.getRemaNumber();
        if (remaNumber != null) {
            stmt.bindString(15, remaNumber);
        }
 
        String roadUtili = entity.getRoadUtili();
        if (roadUtili != null) {
            stmt.bindString(16, roadUtili);
        }
 
        String resLength = entity.getResLength();
        if (resLength != null) {
            stmt.bindString(17, resLength);
        }
 
        String note = entity.getNote();
        if (note != null) {
            stmt.bindString(18, note);
        }
 
        String srcYear = entity.getSrcYear();
        if (srcYear != null) {
            stmt.bindString(19, srcYear);
        }
 
        String category = entity.getCategory();
        if (category != null) {
            stmt.bindString(20, category);
        }
 
        String type = entity.getType();
        if (type != null) {
            stmt.bindString(21, type);
        }
 
        String typeId = entity.getTypeId();
        if (typeId != null) {
            stmt.bindString(22, typeId);
        }
 
        String types = entity.getTypes();
        if (types != null) {
            stmt.bindString(23, types);
        }
 
        String pipe_laying_state = entity.getPipe_laying_state();
        if (pipe_laying_state != null) {
            stmt.bindString(24, pipe_laying_state);
        }
 
        String state = entity.getState();
        if (state != null) {
            stmt.bindString(25, state);
        }
 
        String backNum = entity.getBackNum();
        if (backNum != null) {
            stmt.bindString(26, backNum);
        }
 
        String num = entity.getNum();
        if (num != null) {
            stmt.bindString(27, num);
        }
 
        String methodName = entity.getMethodName();
        if (methodName != null) {
            stmt.bindString(28, methodName);
        }
 
        String length = entity.getLength();
        if (length != null) {
            stmt.bindString(29, length);
        }
 
        String line_len = entity.getLine_len();
        if (line_len != null) {
            stmt.bindString(30, line_len);
        }
 
        Long item_id = entity.getItem_id();
        if (item_id != null) {
            stmt.bindLong(31, item_id);
        }
 
        String latA = entity.getLatA();
        if (latA != null) {
            stmt.bindString(32, latA);
        }
 
        String latB = entity.getLatB();
        if (latB != null) {
            stmt.bindString(33, latB);
        }
 
        String lonA = entity.getLonA();
        if (lonA != null) {
            stmt.bindString(34, lonA);
        }
 
        String lonB = entity.getLonB();
        if (lonB != null) {
            stmt.bindString(35, lonB);
        }
        stmt.bindLong(36, entity.getName_a());
        stmt.bindLong(37, entity.getName_b());
 
        String parallelPole = entity.getParallelPole();
        if (parallelPole != null) {
            stmt.bindString(38, parallelPole);
        }
 
        String isT = entity.getIsT();
        if (isT != null) {
            stmt.bindString(39, isT);
        }
 
        String path = entity.getPath();
        if (path != null) {
            stmt.bindString(40, path);
        }
 
        String moduleID = entity.getModuleID();
        if (moduleID != null) {
            stmt.bindString(41, moduleID);
        }
 
        String moduleTxt = entity.getModuleTxt();
        if (moduleTxt != null) {
            stmt.bindString(42, moduleTxt);
        }
 
        String legendTypeKey = entity.getLegendTypeKey();
        if (legendTypeKey != null) {
            stmt.bindString(43, legendTypeKey);
        }
 
        String fenZhiLineId = entity.getFenZhiLineId();
        if (fenZhiLineId != null) {
            stmt.bindString(44, fenZhiLineId);
        }
        stmt.bindLong(45, entity.getFenZhiLineChecked() ? 1L: 0L);
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, Line entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String lineId = entity.getLineId();
        if (lineId != null) {
            stmt.bindString(2, lineId);
        }
 
        String cid = entity.getCid();
        if (cid != null) {
            stmt.bindString(3, cid);
        }
 
        String start_id = entity.getStart_id();
        if (start_id != null) {
            stmt.bindString(4, start_id);
        }
 
        String end_id = entity.getEnd_id();
        if (end_id != null) {
            stmt.bindString(5, end_id);
        }
 
        Long projectId = entity.getProjectId();
        if (projectId != null) {
            stmt.bindLong(6, projectId);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(7, name);
        }
 
        String roadPands = entity.getRoadPands();
        if (roadPands != null) {
            stmt.bindString(8, roadPands);
        }
 
        String roadAdress = entity.getRoadAdress();
        if (roadAdress != null) {
            stmt.bindString(9, roadAdress);
        }
 
        String resType = entity.getResType();
        if (resType != null) {
            stmt.bindString(10, resType);
        }
 
        String resSpec = entity.getResSpec();
        if (resSpec != null) {
            stmt.bindString(11, resSpec);
        }
 
        String dlzjSpec = entity.getDlzjSpec();
        if (dlzjSpec != null) {
            stmt.bindString(12, dlzjSpec);
        }
 
        String ardUseNumer = entity.getArdUseNumer();
        if (ardUseNumer != null) {
            stmt.bindString(13, ardUseNumer);
        }
 
        String electriHoleNumer = entity.getElectriHoleNumer();
        if (electriHoleNumer != null) {
            stmt.bindString(14, electriHoleNumer);
        }
 
        String remaNumber = entity.getRemaNumber();
        if (remaNumber != null) {
            stmt.bindString(15, remaNumber);
        }
 
        String roadUtili = entity.getRoadUtili();
        if (roadUtili != null) {
            stmt.bindString(16, roadUtili);
        }
 
        String resLength = entity.getResLength();
        if (resLength != null) {
            stmt.bindString(17, resLength);
        }
 
        String note = entity.getNote();
        if (note != null) {
            stmt.bindString(18, note);
        }
 
        String srcYear = entity.getSrcYear();
        if (srcYear != null) {
            stmt.bindString(19, srcYear);
        }
 
        String category = entity.getCategory();
        if (category != null) {
            stmt.bindString(20, category);
        }
 
        String type = entity.getType();
        if (type != null) {
            stmt.bindString(21, type);
        }
 
        String typeId = entity.getTypeId();
        if (typeId != null) {
            stmt.bindString(22, typeId);
        }
 
        String types = entity.getTypes();
        if (types != null) {
            stmt.bindString(23, types);
        }
 
        String pipe_laying_state = entity.getPipe_laying_state();
        if (pipe_laying_state != null) {
            stmt.bindString(24, pipe_laying_state);
        }
 
        String state = entity.getState();
        if (state != null) {
            stmt.bindString(25, state);
        }
 
        String backNum = entity.getBackNum();
        if (backNum != null) {
            stmt.bindString(26, backNum);
        }
 
        String num = entity.getNum();
        if (num != null) {
            stmt.bindString(27, num);
        }
 
        String methodName = entity.getMethodName();
        if (methodName != null) {
            stmt.bindString(28, methodName);
        }
 
        String length = entity.getLength();
        if (length != null) {
            stmt.bindString(29, length);
        }
 
        String line_len = entity.getLine_len();
        if (line_len != null) {
            stmt.bindString(30, line_len);
        }
 
        Long item_id = entity.getItem_id();
        if (item_id != null) {
            stmt.bindLong(31, item_id);
        }
 
        String latA = entity.getLatA();
        if (latA != null) {
            stmt.bindString(32, latA);
        }
 
        String latB = entity.getLatB();
        if (latB != null) {
            stmt.bindString(33, latB);
        }
 
        String lonA = entity.getLonA();
        if (lonA != null) {
            stmt.bindString(34, lonA);
        }
 
        String lonB = entity.getLonB();
        if (lonB != null) {
            stmt.bindString(35, lonB);
        }
        stmt.bindLong(36, entity.getName_a());
        stmt.bindLong(37, entity.getName_b());
 
        String parallelPole = entity.getParallelPole();
        if (parallelPole != null) {
            stmt.bindString(38, parallelPole);
        }
 
        String isT = entity.getIsT();
        if (isT != null) {
            stmt.bindString(39, isT);
        }
 
        String path = entity.getPath();
        if (path != null) {
            stmt.bindString(40, path);
        }
 
        String moduleID = entity.getModuleID();
        if (moduleID != null) {
            stmt.bindString(41, moduleID);
        }
 
        String moduleTxt = entity.getModuleTxt();
        if (moduleTxt != null) {
            stmt.bindString(42, moduleTxt);
        }
 
        String legendTypeKey = entity.getLegendTypeKey();
        if (legendTypeKey != null) {
            stmt.bindString(43, legendTypeKey);
        }
 
        String fenZhiLineId = entity.getFenZhiLineId();
        if (fenZhiLineId != null) {
            stmt.bindString(44, fenZhiLineId);
        }
        stmt.bindLong(45, entity.getFenZhiLineChecked() ? 1L: 0L);
    }

    @Override
    protected final void attachEntity(Line entity) {
        super.attachEntity(entity);
        entity.__setDaoSession(daoSession);
    }

    @Override
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }    

    @Override
    public Line readEntity(Cursor cursor, int offset) {
        Line entity = new Line( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // lineId
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // cid
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // start_id
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // end_id
            cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5), // projectId
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // name
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // roadPands
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // roadAdress
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // resType
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // resSpec
            cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // dlzjSpec
            cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // ardUseNumer
            cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // electriHoleNumer
            cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // remaNumber
            cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // roadUtili
            cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // resLength
            cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // note
            cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // srcYear
            cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // category
            cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // type
            cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // typeId
            cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // types
            cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // pipe_laying_state
            cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // state
            cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // backNum
            cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26), // num
            cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27), // methodName
            cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28), // length
            cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // line_len
            cursor.isNull(offset + 30) ? null : cursor.getLong(offset + 30), // item_id
            cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31), // latA
            cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32), // latB
            cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33), // lonA
            cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34), // lonB
            cursor.getInt(offset + 35), // name_a
            cursor.getInt(offset + 36), // name_b
            cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37), // parallelPole
            cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38), // isT
            cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39), // path
            cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40), // moduleID
            cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41), // moduleTxt
            cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42), // legendTypeKey
            cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43), // fenZhiLineId
            cursor.getShort(offset + 44) != 0 // fenZhiLineChecked
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, Line entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
        entity.setLineId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setCid(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setStart_id(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setEnd_id(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setProjectId(cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5));
        entity.setName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setRoadPands(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setRoadAdress(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setResType(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setResSpec(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
        entity.setDlzjSpec(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
        entity.setArdUseNumer(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
        entity.setElectriHoleNumer(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
        entity.setRemaNumber(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
        entity.setRoadUtili(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
        entity.setResLength(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
        entity.setNote(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
        entity.setSrcYear(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
        entity.setCategory(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
        entity.setType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
        entity.setTypeId(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
        entity.setTypes(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
        entity.setPipe_laying_state(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
        entity.setState(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
        entity.setBackNum(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25));
        entity.setNum(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26));
        entity.setMethodName(cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27));
        entity.setLength(cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28));
        entity.setLine_len(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
        entity.setItem_id(cursor.isNull(offset + 30) ? null : cursor.getLong(offset + 30));
        entity.setLatA(cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31));
        entity.setLatB(cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32));
        entity.setLonA(cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33));
        entity.setLonB(cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34));
        entity.setName_a(cursor.getInt(offset + 35));
        entity.setName_b(cursor.getInt(offset + 36));
        entity.setParallelPole(cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37));
        entity.setIsT(cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38));
        entity.setPath(cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39));
        entity.setModuleID(cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40));
        entity.setModuleTxt(cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41));
        entity.setLegendTypeKey(cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42));
        entity.setFenZhiLineId(cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43));
        entity.setFenZhiLineChecked(cursor.getShort(offset + 44) != 0);
     }
    
    @Override
    protected final Long updateKeyAfterInsert(Line entity, long rowId) {
        entity.setId(rowId);
        return rowId;
    }
    
    @Override
    public Long getKey(Line entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

    @Override
    public boolean hasKey(Line entity) {
        return entity.getId() != null;
    }

    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }
    
    /** Internal query to resolve the "lineList" to-many relationship of Point. */
    public List<Line> _queryPoint_LineList(Long pointId) {
        synchronized (this) {
            if (point_LineListQuery == null) {
                QueryBuilder<Line> queryBuilder = queryBuilder();
                queryBuilder.join(PointAndLineBean.class, PointAndLineBeanDao.Properties.LineId)
                    .where(PointAndLineBeanDao.Properties.PointId.eq(pointId));
                point_LineListQuery = queryBuilder.build();
            }
        }
        Query<Line> query = point_LineListQuery.forCurrentThread();
        query.setParameter(0, pointId);
        return query.list();
    }

    /** Internal query to resolve the "lineList" to-many relationship of Project. */
    public List<Line> _queryProject_LineList(Long projectId) {
        synchronized (this) {
            if (project_LineListQuery == null) {
                QueryBuilder<Line> queryBuilder = queryBuilder();
                queryBuilder.where(Properties.ProjectId.eq(null));
                project_LineListQuery = queryBuilder.build();
            }
        }
        Query<Line> query = project_LineListQuery.forCurrentThread();
        query.setParameter(0, projectId);
        return query.list();
    }

}
